import time
import yagmail,logging
import yaml

t=time.strftime('%Y%m%d-%H%M%S',time.localtime())

def qudong(file):
    with open(file,'r',encoding='utf-8') as f:
        return yaml.safe_load(f)
def log():
    logging.basicConfig(
        filename=f'{t}.log',
        level=logging.DEBUG,
        filemode='a+',
        format='%(filename)s' '%(levelname)s' '%(message)s' '%(asctime)s' '%(lineno)d'
    )
def Youjian(file):
    mail=yagmail.SMTP(user='2018675435@qq.com',password='nnqakcckuzyqfebd',host='smtp.qq.com')
    mail.send(to='2018675435@qq.com',subject='酒仙网自动化脚本',contents='po+pytest酒仙网',attachments=file)

